public with sharing class CallidusPlanManageCS
{
	public Sales_Contract__c sc {get; set;}
	public CallidusPlanControl__c cpc {get; set;}
    public CallidusPlanManageCS()
    {
    	sc = new Sales_Contract__c();
    }
    
    public pagereference getDetails()
    {
    	cpc = CallidusPlanControl__c.getInstance(sc.User_ID__c);	
    	return null;
    } 
    
    public PageReference save()
    {
    	update cpc;
    	User[] u = [select name from User where id = :sc.User_ID__c];
    	if(u.size() > 0)
    		Apexpages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'Settings saved successfully for '+u[0].name+'.'));
    	return null;
    }
    
    public PageReference reset()
    {
    	sc = new Sales_Contract__c();
    	cpc = null;
    	return null;
    }
    
}